package com.railway.service.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.railway.bean.Images;
import com.railway.dao.ImagesDao;
import com.railway.dao.impl.ImagesDaoImpl;
import com.railway.service.ImagesService;

public class ImagesServiceImpl implements ImagesService {
	
	ImagesDao imagesdao = new ImagesDaoImpl();
	
	@Override
	public Map<String, String> selectImage() {
		List<Images> list = imagesdao.selectImage();
		String id;
		
		String url;
		Map<String,String> map = new HashMap();
		if(list.size()>0) {
			for(Images image:list) {
				id = Integer.toString(image.getImageId());
				url = image.getUrl();
				map.put(id, url);
			}
			return map;
		}else {
			return null;
		}
	}

}
